#include <iostream>
#include <memory>
#include <vector>

class Test {
public:
    Test() { std::cout << "Test::Test()" << std::endl; }
    ~Test() { std::cout << "Test::~Test()" << std::endl; }
};

int TestFunc() {
    throw std::runtime_error("this is a runtime error");
    return 0;
}

void ProcessTest(std::shared_ptr<Test> p, int)
{
    //...
}

int main() {
    {
        auto uptr = std::make_unique<int>(10);
        std::unique_ptr<int> uptr1(new int(10));
    }

    {
        try
        {
            ProcessTest(std::shared_ptr<Test>(new Test), TestFunc());
        }
        catch(const std::exception& e)
        {
            std::cerr << e.what() << '\n';
        }
    }
    {
        try
        {
            ProcessTest(std::make_shared<Test>(), TestFunc());
        }
        catch(const std::exception& e)
        {
            std::cerr << e.what() << '\n';
        }
    }

    {
        //std::make_shared<std::vector<int>>({10, 20, 30});
    }
}